﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit" 
    xmlns:visualizationToolkit="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit" 
    xmlns:System_Windows_Controls_DataVisualization_Charting_Primitives="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit" 
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" 
    >

    <ControlTemplate x:Key="PieDataPointTemplate" TargetType="chartingToolkit:PieDataPoint">
        <Grid x:Name="Root" Opacity="0">
            <vsm:VisualStateManager.VisualStateGroups>
                <vsm:VisualStateGroup x:Name="CommonStates">
                    <vsm:VisualStateGroup.Transitions>
                        <vsm:VisualTransition GeneratedDuration="0:0:0.1"/>
                    </vsm:VisualStateGroup.Transitions>
                    <vsm:VisualState x:Name="Normal"/>
                    <vsm:VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverHighlight" Storyboard.TargetProperty="Opacity" To="0.6"/>
                        </Storyboard>
                    </vsm:VisualState>
                </vsm:VisualStateGroup>
                <vsm:VisualStateGroup x:Name="SelectionStates">
                    <vsm:VisualStateGroup.Transitions>
                        <vsm:VisualTransition GeneratedDuration="0:0:0.1"/>
                    </vsm:VisualStateGroup.Transitions>
                    <vsm:VisualState x:Name="Unselected"/>
                    <vsm:VisualState x:Name="Selected">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="SelectionHighlight" Storyboard.TargetProperty="Opacity" To="0.6"/>
                        </Storyboard>
                    </vsm:VisualState>
                </vsm:VisualStateGroup>
                <vsm:VisualStateGroup x:Name="RevealStates">
                    <vsm:VisualStateGroup.Transitions>
                        <vsm:VisualTransition GeneratedDuration="0:0:0.5"/>
                    </vsm:VisualStateGroup.Transitions>
                    <vsm:VisualState x:Name="Shown">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="1"/>
                        </Storyboard>
                    </vsm:VisualState>
                    <vsm:VisualState x:Name="Hidden">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="0"/>
                            
                        </Storyboard>
                    </vsm:VisualState>
                </vsm:VisualStateGroup>
            </vsm:VisualStateManager.VisualStateGroups>
            <Path x:Name="Slice" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeMiterLimit="1" Data="{TemplateBinding Geometry}">
                <ToolTipService.ToolTip>
                    <StackPanel Orientation="Horizontal">
                        <ContentControl Content="{TemplateBinding IndependentValue}"/>
                        <TextBlock Text=" ["/>
                        <ContentControl Content="{TemplateBinding DependentValue}"/>
                        <TextBlock Text=", "/>
                        <ContentControl Content="{TemplateBinding FormattedRatio}"/>
                        <TextBlock Text="]"/>
                    </StackPanel>
                </ToolTipService.ToolTip>
            </Path>
            <Path x:Name="SelectionHighlight" Fill="Red" StrokeMiterLimit="1" IsHitTestVisible="False" Opacity="0" Data="{TemplateBinding GeometrySelection}"/>
            <Path x:Name="MouseOverHighlight" Fill="White" StrokeMiterLimit="1" IsHitTestVisible="False" Opacity="0" Data="{TemplateBinding GeometryHighlight}"/>
        </Grid>
    </ControlTemplate>

    <Style x:Key="PieChartStyle" TargetType="chartingToolkit:Chart">
        <Setter Property="BorderBrush" Value="#FFFFFFFF"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Background">
            <Setter.Value>
                <RadialGradientBrush>
                    <GradientStop Color="#FFFFFFFF" Offset="0"/>
                    <GradientStop Color="#FF095188" Offset="5.0"/>                    
                </RadialGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="StylePalette">
            <Setter.Value>
                <visualizationToolkit:StylePalette>
                    <Style TargetType="Control">     
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFB9D6F7"/>
                                    <GradientStop Color="#FF284B70" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="Control">
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFFBB7B5"/>
                                    <GradientStop Color="#FF702828" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="Control">
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFB8C0AC"/>
                                    <GradientStop Color="#FF5F7143" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="Control">
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFFDE79C"/>
                                    <GradientStop Color="#FFF6BC0C" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="Control">
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFA9A3BD"/>
                                    <GradientStop Color="#FF382C6C" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="Control">
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFB1A1B1"/>
                                    <GradientStop Color="#FF50224F" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="Control">
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FF9DC2B3"/>
                                    <GradientStop Color="#FF1D7554" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="Control">
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFB5B5B5"/>
                                    <GradientStop Color="#FF4C4C4C" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="Control">
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FF98C1DC"/>
                                    <GradientStop Color="#FF0271AE" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="Control">
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFC1C0AE"/>
                                    <GradientStop Color="#FF706E41" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="Control">
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFADBDC0"/>
                                    <GradientStop Color="#FF446A73" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="Control">
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FF2F8CE2"/>
                                    <GradientStop Color="#FF0C3E69" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="Control">
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFDCDCDC"/>
                                    <GradientStop Color="#FF757575" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="Control">
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFF4F4F4"/>
                                    <GradientStop Color="#FFB7B7B7" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="Control">
                        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate}" />
                        <Setter Property="Background">
                            <Setter.Value>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.09" ScaleY="1.819"/>
                                            <TranslateTransform X="-0.425" Y="-0.486"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#FFF4F4F4"/>
                                    <GradientStop Color="#FFA3A3A3" Offset="1"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </visualizationToolkit:StylePalette>
            </Setter.Value>
        </Setter>       
        <Setter Property="TitleStyle">
            <Setter.Value>
                <Style TargetType="visualizationToolkit:Title">
                    <Setter Property="FontSize" Value="15"/>
                    <Setter Property="HorizontalAlignment" Value="Center"/>
                    <Setter Property="Margin" Value="0,5,0,5"/>
                    <Setter Property="Foreground" Value="#FFFFFFFF"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="LegendStyle">
            <Setter.Value>
                <Style TargetType="visualizationToolkit:Legend">
                    <Setter Property="FontSize" Value="10"/>
                    <Setter Property="Margin" Value="0,0,0,0"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                    <Setter Property="BorderBrush" Value="Transparent"/>
                    <Setter Property="Background" Value="Transparent"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="ChartAreaStyle">
            <Setter.Value>
                <Style TargetType="Panel">
                    <Setter Property="MinWidth" Value="100"/>
                    <Setter Property="MinHeight" Value="75"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="PlotAreaStyle">
            <Setter.Value>
                <Style TargetType="Grid">
                    <Setter Property="Background" Value="Transparent"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="chartingToolkit:Chart">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <visualizationToolkit:Title Style="{TemplateBinding TitleStyle}" Content="{TemplateBinding Title}"/>
                            <Grid Margin="0,0,0,0" Grid.Row="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <visualizationToolkit:Legend x:Name="Legend" Style="{TemplateBinding LegendStyle}" Grid.Column="1" Title="{TemplateBinding LegendTitle}"/>
                                <System_Windows_Controls_DataVisualization_Charting_Primitives:EdgePanel x:Name="ChartArea" Style="{TemplateBinding ChartAreaStyle}">
                                    <Grid Style="{TemplateBinding PlotAreaStyle}" Canvas.ZIndex="-1"/>
                                    <Border Canvas.ZIndex="10" BorderBrush="#FFFFFFFF" BorderThickness="0"/>
                                </System_Windows_Controls_DataVisualization_Charting_Primitives:EdgePanel>
                            </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

   
    
	<!--<Style x:Key="PieDataPointStyle" TargetType="chartingToolkit:PieDataPoint">
		<Setter Property="Background" Value="Orange"/>
		<Setter Property="BorderBrush" Value="White"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="IsTabStop" Value="False"/>
		<Setter Property="RatioStringFormat" Value="{}{0:p2}"/>
        <Setter Property="Template" Value="{StaticResource PieDataPointTemplate" />
    </Style>-->

</ResourceDictionary>